package com.aiyige.model.task;

/**
 * Created by xiachao on 2018/1/29.
 */

/**
 * 比传参数是name和params
 * batchDeleteSomeFavoriteRecords
 * batchDeleteSomeViewRecords
 * batchDeleteAllUserKeywords
 * batchDeleteAllUserTagRecords
 * batchDeleteSomeUserCartProducts
 */
public class Task {

    public static final String batchDeleteSomeFavoriteRecords = "batchDeleteSomeFavoriteRecords";
    public static final String batchDeleteSomeViewRecords = "batchDeleteSomeViewRecords";
    public static final String batchDeleteAllUserKeywords = "batchDeleteAllUserKeywords";
    public static final String batchDeleteAllUserTagRecords = "batchDeleteAllUserTagRecords";
    public static final String batchDeleteSomeUserCartProducts = "batchDeleteSomeUserCartProducts";
    public static final String batchDeleteAllUserAvocationKeywords = "batchDeleteAllUserAvocationKeywords";

    String id;//任务ID
    String name;//		是			任务名，唯一不重复，请根据下面列表定义的传入

    private Task(Builder builder) {
        setName(builder.name);
        setParams(builder.params);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ParamsIds getParams() {
        return params;
    }

    public void setParams(ParamsIds params) {
        this.params = params;
    }

    ParamsIds params;//	json	是			任务数据，按照样例格式传入
    Integer type;//		否			cycle-重复执行，immediately-立即执行一次，scheduled-预定时间执行一次，默认immediately
    Integer status;//		否			状态：0-新建，1-开始执行，2-完成，3-取消
    String creator;//		是			创建人用户ID，OA内部用eig
    Long createTime;//		否			创建时间，毫秒
    Long updateTime;//		否			更新时间，毫秒

    public static final class Builder {
        private String name;
        private ParamsIds params;

        private Builder() {
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder params(ParamsIds params) {
            this.params = params;
            return this;
        }

        public Task build() {
            return new Task(this);
        }
    }
}
